#include "fxcc/core/graph/common/GraphImpl.h"
#include "fxcc/core/graph/opengl3/MeshJack.h"
#include "fxcc/core/graph/opengl3/Texture2DJack.h"
#include "fxcc/core/graph/opengl3/Texture2DArrayJack.h"
#include "fxcc/core/graph/opengl3/Texture3DJack.h"
#include "fxcc/core/graph/opengl3/TextureCubeJack.h"
#include "fxcc/core/graph/opengl3/TextureCubeArrayJack.h"
#include "fxcc/core/graph/opengl3/RenderTargetJack.h"

std::shared_ptr<fxcc::graph::common::MeshJack> fxcc::graph::common::GraphImpl::CreateMSDFMesh(const fxcc::graph::common::MSDFGeoData& geo)
{
    return std::make_shared<fxcc::graph::opengl3::MeshJack>(geo);
}

std::shared_ptr<fxcc::graph::common::MeshJack> fxcc::graph::common::GraphImpl::CreateSDFMesh(const fxcc::graph::common::SDFGeoData& geo)
{

    //VertexArray::Create();
    //VertexArray::Bind();
    //m_IndexBuffer.Bind();
    //m_IndexBuffer.BufferData<unsigned int>(geoData.indices32);
    //LoadSDFBuffersFrom(geoData);

    //m_IndexType = fxcc::graph::common::IndexType::_index_unsigned_int_;
    //m_VertexType = fxcc::graph::common::VertexType::_vertex_font_;
    //m_ModeType = fxcc::graph::common::ModeType::_mode_Triangles_;
    //m_NumIndices = geoData.indices32.size();
    //m_NumVertices = geoData.vertices.size();

    //OnEndCreate();
    assert("Developing");
    return 0;
    //return std::make_shared<fxcc::graph::opengl3::MeshJack>(geo);
}

std::shared_ptr<fxcc::graph::common::MeshJack> fxcc::graph::common::GraphImpl::CreateFixedMesh(const fxcc::graph::common::GeometryData& geo)
{
    return std::make_shared<fxcc::graph::opengl3::MeshJack>(geo);
}

std::shared_ptr<fxcc::graph::common::MeshJack> fxcc::graph::common::GraphImpl::CreateSkinnedMesh(const fxcc::graph::common::GeometryData& geo, const fxcc::graph::common::SkinnedMeshData& skinnedMeshData)
{
    return std::make_shared<fxcc::graph::opengl3::MeshJack>(geo, skinnedMeshData);
}

std::shared_ptr<fxcc::graph::common::Texture2DJack> fxcc::graph::common::GraphImpl::CreateTexture2D(const fxcc::graph::common::Texture2DJack::Desc& desc)
{
    return std::make_shared<fxcc::graph::opengl3::Texture2DJack>(desc);
}

std::shared_ptr<fxcc::graph::common::Texture3DJack> fxcc::graph::common::GraphImpl::CreateTexture3D(const fxcc::graph::common::Texture3DJack::Desc& desc)
{
    return std::make_shared<fxcc::graph::opengl3::Texture3DJack>(desc);
}

std::shared_ptr<fxcc::graph::common::Texture2DArrayJack> fxcc::graph::common::GraphImpl::CreateTexture2DArray(const fxcc::graph::common::Texture2DArrayJack::Desc& desc)
{
    return std::make_shared<fxcc::graph::common::Texture2DArrayJack>(desc);
}

std::shared_ptr<fxcc::graph::common::RenderTargetJack> fxcc::graph::common::GraphImpl::CreateRT(const fxcc::graph::common::RenderTargetJack::Desc& desc)
{
    return std::make_shared<fxcc::graph::opengl3::RenderTargetJack>(desc);
}

std::shared_ptr<fxcc::graph::common::TextureCubeJack> fxcc::graph::common::GraphImpl::CreateTextureCube(const fxcc::graph::common::TextureCubeJack::Desc& desc)
{
    return std::make_shared<fxcc::graph::opengl3::TextureCubeJack>(desc);
}

std::shared_ptr<fxcc::graph::common::TextureCubeArrayJack> fxcc::graph::common::GraphImpl::CreateTextureCubeArray(const fxcc::graph::common::TextureCubeArrayJack::Desc& desc)
{
    return std::make_shared<fxcc::graph::opengl3::TextureCubeArrayJack>(desc);
}